<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<title>6.863 Project: Policy Parser</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

	<!-- Begin Wrapper -->
	
		<div id="wrapper">
		
		<!-- Begin Header -->
			
			<div id="header">
				<h1>Policy Parser</h1>
				<h2>6.863 Spring 2008 Project</h2>		 
			</div>
			
		<!-- End Header -->
			
		<!-- Begin Strap -->
		
        <div id="strap">
<b>Policy Parser</b> &raquo; Try it Now!</div>
		
		<!-- End Strap -->
		 
		<!-- Begin Navigation -->
		
		<div id="navigation">
			<ul id="menu">
				<li><a href="index.html">Home</a></li>
				<li><a href="intro.html">Intro</a></li>
			    <li><a href="#">Try It Now!</a></li>
	            <li><a href="implementation.html">Implementation</a></li>
                <li><a href="results.html">Results</a></li>
	            <li><a href="future.html">Future Directions</a></li>
	            <li><a href="download.html">Download Code</a></li>
 			 	<li><a href="members.html">Members</a></li>
			</ul>
		</div>
		
		<!-- End Navigation -->
		 
		<!-- Begin Content-->

		<div id="content">
		
		<p>We have developed a Firefox sidebar extension 
          which lets users write 
		  a constrained natural language sentence and parse it. 
          You can download and install
		  it from:<br/>
		<a href="http://justparseit.googlecode.com/files/PolicyParser.xpi">http://justparseit.googlecode.com/files/PolicyParser.xpi</a><br />
        (Note: This toolbar is compatible with Firefox 2.0 only)</p><br/>
		
		<p>Once it is installed on Firefox you can activate it by selecting "View -> Sidebar -> Policy Parser".<br/>
		The sidebar will be displayed as follows:</p><br/>
		<div style="text-align: center;">
        	<img src="images/sidebar.png" alt="Policy Parser Firefox Sidebar"/>
            <p>Figure 1: Policy Parser Firefox Sidebar</p><br/>
        </div>
		
		<br/>
		
		<h3>Optional Pre-requisite:</h3>
		
		<br/>
		
		<div>Please install <a href="http://dig.csail.mit.edu/2007/tab/release/tabulator-0-8-3.xpi">Tabulator Firefox Extension</a>. This is not 
		<strong>required</strong> for the "Policy Parser" to work. However, it would render 
		the output rdf/n3 nicely on the browser itself. The absence of the Tabulator extension will make you download the generated file, and you will have to open
		it with a text editor to view the contents.</div>
		
		<br/>
		
		<h3>Using the Policy Editor Sidebar:</h3>
		
		<br/>
		
		<div>
		First of all the user will have to specify a name for the policy that he/she intends to create. This name could be something like "MIT Prox Card Data Policy"
		or "Massachusetts Disability Discrimination Policy". It is up to the user to select a meaningful name.</div>
		
		<br/>
		
		<div>The user will then have to select a particular domain ontology. Once the domain ontology is selected the user can view the contents of the ontology
		by clicking the "View" button. It should be borne in mind that the lexicon of the the system is limited by the phrases indicated in the 
		<code>rdfs:label</code> tags. Therefore it would be a good practice to look at the domain ontology (especially if you are writing your own sentence).
		The following figure shows a typical domain ontology:</div>
		
		<br/>
		
		<div style="text-align: center;">
        	<img src="images/ontology.png" width="100%" alt="Domain Ontology"/>
            <p>Figure 2: Example Domain Ontology</p><br/>
        </div>
		
		<br/>
		
		<div>When inputing a sentence, the user has two options. He/she can select from pre-defined sentences displayed in the drop-down box (which are guaranteed to work) OR input a 
		sentence manually by looking at the sentence format.</div>
		
		<br/>
		
		<div>Once a name is given to the policy, a domain ontology is selected, and a sentence is specified, the user can press the "parse" button. This will invoke
		the python Policy Parser web service hosted at http://scripts.mit.edu/~oshani/justparseit/code/server/run.py
		with the corresponding parameters. Please note that there could be a slight delay in seeing the actual result (so please be patient!). Once the result
		is sent back to the browser, provided that you have installed Tabulator you would be able to see the following: </div>

		<br/>
		
		<a href="images/policy_output_tab.png" target="_blank">		
		<div style="text-align: center;">
        	<img src="images/policy_output_tab.png" width="100%" alt="Policy Parser Output"/>
            <p>Figure 3: Policy Parser Output on Firefox if Tabulator Extension is installed</p><br/>
        </div>
		</a>
		
		<br/>

		<div>If you do not have Tabulator installed, you would be asked to download a file. Once you open that file, you could see the generated AIR policy similar
		to the following:</div>
		<br/>

		<div style="text-align: center;">
        	<img src="images/policy_output_normal.png" alt="Policy Parser Output"/>
            <p>Figure 4: Policy Parser Output if Tabulator is not installed</p><br/>
        </div>

		<br/>

		
		<div>Now that you have generated the AIR policy you could make it persistant by either storing it in your local file system, or somewhere on the World Wide Web.
		For demonstration purposes, we have chosen to save it in a WebDAV space so that it will be universally accessible through a Universal Resource Identifier (URI).
		If you have your own WebDav space, please feel free to enter it in the text box underneath "Store the generated policy here: ". By default this text box 
		contains the value:<br/> <code>http://dig.csail.mit.edu/2008/webdav/policy.n3</code>. 
		<br/>
		You could enter a new name instead of "policy.n3" and click the "Store Policy"
		button. When storing the policy it will ask for authorization. You can try out this feature by using the temperory username "policyparser" and password
		"policyparser". Once you have clicked the "Store Policy" you could view the policy in it's new storage location by clicking the "View Policy" button.</div>

		<br/>
		
		<div>If you are interested, you can see how this generated policy may be reasoned over a log file (which includes a set of facts) by the AIR reasoner.
		For this particular demo, you would have to select a log file from the drop down box, and press the "Fetch Log" button. If you wish to see the contents
		of the log file, you have to click the "View Log" button. Once you have cicked it you should be able to see the following:</div>
		
		<br/>

		<div style="text-align: center;">
        	<img src="images/log.png" alt="Sample Log File"/>
            <p>Figure 5: Sample Log File</p><br/>
        </div>

		<br/>
		
		<div>If you have performed all the steps above, you are all set to invoke the AIR reasoner. Click the "Run Reasoner" button and you should be able to get 
		the following output:</div>

		<br/>
		
		<a name="fig6">
		<div style="text-align: center;">
        	<img src="images/current_output.png" alt="Current Output from the AIR reasoner"/>
            <p>Figure 6: Current Output from the AIR reasoner</p><br/>
        </div>
		</a>
		<br/>
		
		</div>
		
		<!-- End Content -->
		
		<!-- Start Footer -->
		
		<div id="footer">
		</div>
		
		<!-- End Footer -->
		 
    </div>
	
    <!-- End Wrapper -->
	
</body>
</html>
